package shared.highcharts.config

import dataclass.data
import java.lang.{ Integer => JInt, Double => JDouble, Boolean => JBoolean }

@data class Chart(
                   `type`: Option[String],
                   height: Option[Double],
                   marginTop: Option[Double],
                   marginBottom: Option[Double],
                 )

object Chart {
  def apply(
             `type`: String = null,
             height: JDouble = null,
             marginTop: JDouble = null,
             marginBottom: JDouble = null,
           ) = new Chart(
    Option(`type`),
    Option(height).map(x => x: Double),
    Option(marginTop).map(x => x: Double),
    Option(marginBottom).map(x => x: Double),
  )
}
